<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div>
        <button id="execute">执行</button>
    </div>
</body>

</html>
<script>
    document.getElementById("execute").onclick = function() {
        class Cats {
            constructor(x, y) {
                    this.full = x;
                    this.name = y;
                }
                //static修饰：只能通过类来调用，不能用实例化
            static calls() {
                return '喊';
            }
            cry() {
                return Cats.calls();
            }
            shout() {

            }
        };
        //继承
        class Tiger extends Cats() {
            constructor(content) {
                super();
                this.name = "豹子";
            }
            bark() {
                return content;
            }
        };
        //forEach
        var arr = ["一个人的", "奥林", "匹克"];
        arr.forEach(function(currentValue, index, arr) {
            console.log(currentValue + "," + index + "," + arr);
        });
        //es6箭头函数
        // ()=>{}==function(){
        // }

        //Object.assign()方法用于将所有可枚举属性的值从一个或多个源对象分配到目标对象。它将返回目标对象。
        function copy(obj) {
            return Object.assign({}, obj)
        }
        //Object.freeze() 方法可以冻结一个对象。
        function frozen(obj) {
            Object.freeze(obj);
        }
    }
</script>